/**
 * ********************************************************
 * <p>
 * Copyright (c) 2018 Baidu.com, Inc. All Rights Reserved
 * <p>
 * ********************************************************
 *
 * @date: 2018年10月26日
 * @author: zhangliuqing01
 * @description: sp query
 */
package com.baidu.mpks.backendweb.ktree.dao;

import java.util.List;
import java.util.Set;

import com.baidu.mpks.backendweb.ktree.domain.TreeNode;

import org.apache.ibatis.annotations.Param;

public interface TreeNodeDao {
    int addNode(TreeNode treeNode);

    List<TreeNode> getTreeNodes();
    
    List<TreeNode> getNodeByIds(@Param("nodeIds") Set<Integer> nodeIds);
    
    Set<TreeNode> getTreeNodesByPermission();
    
    Set<TreeNode> getPermittedNodeByUserIdAndRoleIds(String userId, List<Integer> roleIds);
    
    Set<TreeNode> getPermittedNodeByRoleId(Integer roleId);

    TreeNode getNodeById(@Param("id") int id);

    void updateNameById(TreeNode treeNode);

    List<Integer> getAllIds();

    List<Integer> getIdByNode(TreeNode treeNode);

    List<Integer> getIdByNameParent(TreeNode treeNode);

    int countByParendId(@Param("parentId") int parentId);

    void deleteById(@Param("id") int id);

    List<Integer> getIdByName(@Param("treeName") String treeName);
}
